ITP_LONDON | PRISCILLA_EMEBO | Module-Data-Flows | Book library - #183
Closed
Priscilla-EM wants to merge 6 commits into
Closed
ITP_LONDON | PRISCILLA_EMEBO | Module-Data-Flows | Book library#183Priscilla-EM wants to merge 6 commits into
Priscilla-EM wants to merge 6 commits into
Conversation
cjyuan
reviewed
Apr 9, 2025
cjyuan
left a comment
Contributor
There was a problem hiding this comment.
I think there are some improvements you can still make to the JS code.
Also, when I checked the code in index.html at https://validator.w3.org/, it indicated some errors.
Comment on lines
34
to
37
| author.value == null || | ||
| author.value == "" || | ||
| pages.value == null || | ||
| pages.value == "" |
Contributor
There was a problem hiding this comment.
In terms of input validation,
- Are all input properly checked?
- Can
.valuebenull? (Do we need to checksomeInputElement.value == null?) - What if a user enters only space characters in the "title" input field?
- What if a users enters
-1or3.1416in the "pages" input field?
Comment on lines
59
to
61
| for (let n = rowsNumber - 1; n > 0; n-- ){ | ||
| table.deleteRow(n); | ||
| } |
Contributor
There was a problem hiding this comment.
Instead of deleting the table rows one by one, can you think of a more efficient way to remove all rows (except the <th>...</th>) in the table?
Contributor
There was a problem hiding this comment.
Line 71: With the way the book's title is assigned to an HTML element, a book with a title containing special character sequence such as <i> can possibly ruin the display.
Lines 77, 95:
- Is the value assigned to these
idattribute unique? - Is there a need to assign an id attribute to
delButton? - Is there a need to assign an id attribute to
changeBut(at line 72)?
Lines 76, 94:
- Can you think of a more consistent way to name the variables representing the two buttons,
changeButanddelButton?
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Learners, PR Template
Self checklist
Changelist
This PR implements a simple Book Library web app using HTML, CSS, and JavaScript. Users can add books with a title, author, page count, and read status. Each book is displayed in a table, with options to toggle its read status or delete it
Questions
Ask any questions you have for your reviewer.